package com.example.cdpbookstore.pojo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer code;    // 200 正常，400错误
    private String msg;
    private T data;

    public static Result<String> message(String msg) {
        return new Result<>(200, msg, null);
    }
}
